<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>接口适配器</title>
  </head>
  <body>
    <script>
      class TencentMap {
        show() {
          console.log("Tenecent Map is loading... Please wait...");
        }
      }

      class BaiduMap {
        display() {
          console.log("Baidu Map is loading... Please wait...");
        }
      }

      // 腾讯适配器，用于接口转换
      class TencentAdapater extends TencentMap {
        display() {
          super.show();
        }
      }

      function mapRender(map) {
        map.display();
      }

      mapRender(new TencentAdapater());
      mapRender(new BaiduMap());
    </script>
  </body>
</html>
